from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough

prompt = ChatPromptTemplate.from_template("问题：{passed_data}")

chain = {
    "passed_data": RunnablePassthrough(),
    "upper_question": lambda x: x["question"].upper(),
} | prompt
print(chain.invoke({"question": "hello"}))
